//
//  TestView.swift
//  SimpleCal
//
//  Created by 杜晓祥 on 2021/10/21.
//

import Cocoa

@IBDesignable
class TestView: NSView {
    
    var label:DULabel!
    
    convenience init() {
        self.init(frame: CGRect.zero)
    }

    override init(frame frameRect: NSRect) {
        super.init(frame: frameRect)
        initialize()
    }
    
    required init?(coder: NSCoder) {
        super.init(coder: coder)
        initialize()
    }
    
    private func initialize () {
        label = DULabel()
        label.frame = NSRect(x: 5, y: 5, width: 100, height: 90)

        label.cell = VerticallyCenteredTextFieldCell(textCell: "AB")
        label.stringValue = "88"
        label.font = NSFont.systemFont(ofSize: 45)
        label.alignment = .center
        addSubview(label)
    }
    
    override func layout() {
        self.layer?.backgroundColor = CGColor(red: 1, green: 1, blue: 1, alpha: 0.6)
    }
    
}
